<?php
	session_start();
	ini_set("include_path", ".:../:./includes:../includes");

	extract($_REQUEST);
	require_once("includes/constants.php");
	require_once("includes/database.php");
	
	$year = 2008;
	$index = 0;
	foreach($_REQUEST as  $key => $timestamp)  {
		if ($timestamp != '' & $key == $timestamp) {
			echo "<br/>" . $timestamp;
			$dat = date( 'Y-m-d', $timestamp );
			$mysqldate[$index++] = $dat;			
		}
	}
	if (setEmployeeHolidays($_SESSION[EMPLOYEES][$selectedEmployee]['e_employee_id'] , $mysqldate)) {
		$confirmationMessage = "Holidays have been set for " . 
			$_SESSION[EMPLOYEES][$selectedEmployee]['e_firstname'] .
			$_SESSION[EMPLOYEES][$selectedEmployee]['e_surname'] ;
		header( 'Location: confirmationPage.php?' . "confirmationMessage=" .$confirmationMessage) ;
	}
	else {
		$errorMessage = "Holidays could not be updated for ". 
			$_SESSION[EMPLOYEES][$selectedEmployee]['e_firstname'] .
			$_SESSION[EMPLOYEES][$selectedEmployee]['e_surname'] ;
		header( 'Location: errorPage.php?' . "errorMessage=" . $errorMessage ) ;
	}	
	;

?>
